package com.jzo2o.customer.controller.agency;

import com.jzo2o.common.model.Result;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("agencyInstitutionBankAccountController")
@RequestMapping("/agency/")
@Api(tags = "机构端银行账户管理相关接口")
public class InstitutionBankAccountController {
    @Resource
    private IBankAccountService bankAccountService;
    @PostMapping("/bank-account")
    @ApiOperation("机构端银行账户绑定或更新")
    public Result insertOrUpdateBankAccount(@RequestBody BankAccountResDTO bankAccountResDTO) {
        bankAccountService.add(bankAccountResDTO);
        return Result.ok();
    }
    @GetMapping("/bank-account/currentUserBankAccount")
    @ApiOperation("查询当前用户银行信息")
    public BankAccountResDTO insertOrUpdateBankAccount() {
        BankAccountResDTO bankAccountResDTO = bankAccountService.queryCurrentUserBankAccount();
        return bankAccountResDTO;
    }
}
